// #region 

// #endregion
function loadExtentFile(filePath, fileType){
    if(fileType == "js"){
        var oJs = document.createElement('script');        
        oJs.setAttribute("type","text/javascript");
        oJs.setAttribute("src", filePath+"?id="+(new Date().getTime()));//文件的地址 ,可为绝对及相对路径
        document.getElementsByTagName("head")[0].appendChild(oJs);//绑定
    }else if(fileType == "css"){
        var oCss = document.createElement("link"); 
        oCss.setAttribute("rel", "stylesheet"); 
        oCss.setAttribute("type", "text/css");  
        oCss.setAttribute("href", filePath+"?id="+(new Date().getTime()));
        document.getElementsByTagName("head")[0].appendChild(oCss);//绑定
    }
}
var storageControl={
    storagable:function(){
        if (typeof(Storage) !== "undefined") {
            return true
         }else{
            console.log("抱歉！您的浏览器不支持 Web Storage ...");
            return false
         }
    },
    isExitStorage:function(keys){
        if(window.localStorage.getItem(keys) != undefined && window.localStorage.getItem(keys) != null && window.localStorage.getItem(keys) != ''){
            return true
        }else{
            return false
        }
    },
    isExitStorageS:function(keys){
        if(window.sessionStorage.getItem(keys) != undefined && window.sessionStorage.getItem(keys) != null && window.sessionStorage.getItem(keys) != ''){
            return true
        }else{
            return false
        }
    },
    islogined:function(){
        if(this.storagable()){
            var _uid = storageControl.getStorage('userId') || ''
            if(_uid == ''){
                window.location.href='./login.html';
            }

        }
    },
    clear:function(){
        if(this.storagable()){
            //var _uid = localStorage.getItem('user_id') || ''
            localStorage.clear();
            sessionStorage.clear();
        }
    },
    setStorage:function(data){
        if(this.storagable()){
            for(var i in data){
                localStorage.setItem(i, data[i]);
            }
        }
    },
    isloginedS:function(){
        if(this.storagable()){
            var _uid = sessionStorage.getItem('user_id') || ''
            var _pathName = window.location.pathname
            //console.log(/login/.test(_pathName))
            if(_uid == '' &&  !/login/.test(_pathName)){
                window.location.href='./login.html';
                return false
            }

        }
    },
    setStorageS:function(data){
        if(this.storagable()){
            for(var i in data){
                sessionStorage.setItem(i, data[i]);
            }
        }
    },
    getStorage:function(keys){
       return window.localStorage.getItem(keys)
    },
    getStorageS:function(keys){
        return window.sessionStorage.getItem(keys)
    },
    removeStorage:function(keys){
        // console.log(this.storagable())
        if(this.storagable()){
            if(typeof keys == 'array' || typeof keys == 'object'){
                for(var j=0;j< keys.length;j++){
                    window.localStorage.removeItem(keys[j])
                }
            }else if(typeof keys == 'string'){
                window.localStorage.removeItem(keys)
            }
            
        }
        
    }
}
// #region 
// loadExtentFile('css/css.css','css')
// loadExtentFile('css/style.css','css')
// // loadExtentFile('slideshow.css','css')
// loadExtentFile('css/newcss.css','css')
// loadExtentFile('css/newstyle.css','css')
// #endregion

var _navData=[
    {cls:'account',url:'index',tit:'店铺首页'},
    {cls:'transact',url:'about',tit:'机构介绍'},
    {cls:'info',url:'vip',tit:'会员中心'}
]
$(function(){
    // var witch = 0;
    if($('.toolbar').length == 1){
        var navVue = new Vue({
            el:'.toolbar',
            data:{
                info:_navData
            },
            methods:{
                href:function(elm){
                    window.location.href = './'+elm.url+'.html'
                }
            }
        })
    }
    
    // #region
    // $('.toolbar li').click(function(){
    //     var _clsArr=$(this).attr('class').split(' ')
    //     var _oldLink =  window.location.href;
    //     var _newLink;
    //     for(var i=_clsArr.length-1;i>=0;i--){
    //         var _cls = _clsArr[i];
    //         switch(_cls){ 
    //             case 'account':
    //                 _newLink = 'index' ;
    //                 break;
    //             case 'transact':
    //                 _newLink ='transact';
    //                 break;
    //             case 'info':
    //                 _newLink ='info';
    //                 break;
    //             case 'setting':
    //                 _newLink ='setting';
    //                 break;
    //         } 
    //     }
    //     if(/_self\.html/.test(_oldLink)){
    //         _newLink += '_self';
    //     }
    //     _newLink += '.html';
    //     var _reg = new RegExp(_newLink);
    //     if(!_reg.test(_oldLink)){
    //         window.location.href = _newLink
    //     }
    // })
    // #endregion

    $.fn.elemInit=function(elem,margin,count,rect){
        var _w=$(this).width();
        if(typeof(count) == 'number'){
            var _wElm=(_w-(count-1)*margin)/count;
        }else{
            var _wElm = count        
        }
        if(rect){
            $(this).find(elem).css({'height':_wElm+'px','width':_wElm+'px','margin-right':margin+'px','margin-bottom':margin+'px'})    
        }else{
            $(this).find(elem).css({'width':_wElm+'px','margin-right':margin+'px','margin-bottom':margin+'px'})
        }
        $(this).find(elem+':nth-child('+count+'n)').css('margin-right','0')     
    }
    window.goHome = function(){
        if(!/_self\.html/.test(window.location.href)){
            window.location.href='index.html';
        }else{ 
            window.location.href = 'index_self.html'
        } 
    }
    window.goHistory = function(){
        window.history.back()
    }
})

var baseFn={
    getQueryString:function(name){
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  decodeURI(r[2]); return null;
    },
    getLocation:function(){
        if (navigator.geolocation)
        {
            navigator.geolocation.getCurrentPosition(function(position){
                console.log(position)
                return {lat:position.coords.latitude,lng:position.coords.longitude}
            });
        }
        else
        {
            return {}
            alert("该浏览器不支持获取地理位置。");
            
        }
    },
    loading:function(type,txt){
        var _this = this
        var _txt = txt?txt:''
        // var _loader = `<div class="loader-container text-center color-white">
        //     <div><i class="fa fa-spinner fa-pulse fa-3x"></i></div>
        //             <div>${_txt}</div>
        //     </div>`
        var _loader = `<div class="lds-css ng-scope">
                <div class="lds-dual-ring">
                    <div></div>
                </div>
                <p>${_txt}</p>
            </div>`
        if(type == 'open'){
            _this.addClass('loader')
            _this.append($(_loader))
        }else if(type == 'close'){
            _this.removeClass('loader')
            $('.loader-container').remove()
            // $('.loader').removeClass('loader')
        }      
    },
    imgSizeOnload:function(dom,sFn,bFn,rts,calFn){
        dom.onload = function(){
            if(dom.width/dom.height <= rts){
                sFn()
            }else{
                bFn()
            }
            if(calFn){
                calFn()
            }
            
        }
        
    },
    imgSize:function(opts){
        var _img = new Image()
        _img.src = opts.imgSrc
        //比rts小s.opts 宽窄高长 适应宽
        //比rts大b.opts 宽长高短 适应高
        if(opts.calFn){
            this.imgSizeOnload(_img,opts.s,opts.b,opts.rts,opts.calFn)
        }else{
            this.imgSizeOnload(_img,opts.s,opts.b,opts.rts)
        }
        
    },
    popShow:function(_opts){
        
        var defaults={
            markdom:'.mark',
            popdom:'.pop',
            oktxt:'确定',
            canceltxt:'取消',
            cancel:false,
            ok:true,
            txt:'<p>文本主体</p>',
            timeable:false,
            time:3000,
            markshow:false
        }
        
        var opts=$.extend({},defaults,_opts)
        $(opts.markdom).addClass('active');
        $(opts.popdom).addClass('active')
        $('.popcnt').html(opts.txt)
        if(opts.cancel == true){
            $(opts.popdom+' .popbtn.cancel').show()
        }else{
            $(opts.popdom+' .popbtn.cancel').hide()
        }
        if((typeof opts.cancel == 'function' || opts.cancel == true) && (typeof opts.ok == 'function' || opts.ok == true)){
            $(opts.popdom+' .popbtn').removeClass('cols12').addClass('cols6')
        }else{
            $(opts.popdom+' .popbtn').removeClass('cols6').addClass('cols12')
        }
        $('.popcancel').text(opts.canceltxt)
        $('.popgo').text(opts.oktxt)
        if(typeof opts.cancel == 'function' || opts.cancel == true){
            $(opts.popdom+' .popcancel').off('click').on('click',function(){
                if(typeof opts.cancel == 'function'){
                    opts.cancel()
                }
                $(opts.markdom).removeClass('active');
                $(opts.popdom).removeClass('active')
            })
        }
        if(typeof opts.ok == 'function' || opts.ok == true){
            $(opts.popdom+' .popgo').off('click').on('click',function(){
                if(typeof opts.ok == 'function'){
                    opts.ok()
                }
                $(opts.markdom).removeClass('active');
                $(opts.popdom).removeClass('active');
                if(opts.markshow){
                    $(opts.markdom).addClass('active'); 
                }
            })
        }
        if(opts.timeable){
            window.setTimeout(function(){
                $(opts.popdom+' .popgo').click()
            },opts.time)
        }
    },
    infoimg:function(opts){
        /*
        <div class="imgwrap">
            <div class="imggroup">
                <div class="imgcnt">
                    <img src="images/banner.jpg" width="100%" alt="">
                </div>
            </div>
        </div>
        */
        var that = this
        var defaults={
            data:[],
            exCls:'',
            apDom:''
        }
        var _opts=$.extend({},defaults,opts||{})
        _opts.len=_opts.data.length;
        var _html='<div class="imgwrap">'
        if(_opts.len%2 == 1 && _opts.len != 1){
            for(var i=0;i<_opts.len-3;i+=2)
            _html +='<div class="imggroup">\
                    <div class="imgcnt w_5">\
                        <div class="imgdiv" style="background-image:url('+_opts.data[i].url+')"></div>\
                    </div>\
                    <div class="imgcnt w_5">\
                        <div class="imgdiv" style="background-image:url('+_opts.data[i+1].url+')"></div>\
                    </div>\
                </div>'
            _html +='<div class="imggroup">\
                        <div class="imgcnt w_3_3">\
                            <div class="imgdiv" style="background-image:url('+_opts.data[_opts.len-3].url+')"></div>\
                        </div>\
                        <div class="imgcnt w_3_3">\
                            <div class="imgdiv" style="background-image:url('+_opts.data[_opts.len-2].url+')"></div>\
                        </div>\
                        <div class="imgcnt w_3_3">\
                            <div class="imgdiv" style="background-image:url('+_opts.data[_opts.len-1].url+')"></div>\
                        </div>\
                    </div>'
        }else if(_opts.len%2 == 0){
            for(var i=0;i<_opts.len;i+=2)
            _html +='<div class="imggroup">\
                        <div class="imgcnt w_5">\
                            <div class="imgdiv" style="background-image:url('+_opts.data[i].url+')"></div>\
                        </div>\
                        <div class="imgcnt w_5">\
                            <div class="imgdiv" style="background-image:url('+_opts.data[i+1].url+')"></div>\
                        </div>\
                    </div>'
        }else if(_opts.len%2 == 1 && _opts.len == 1){
            _html +='<div class="imggroup">\
                        <div class="imgcnt w_10">\
                            <div class="imgdiv" style="background-image:url('+_opts.data[0].url+')"></div>\
                        </div>\
                    </div>'
        }
        _html +='</div>'
        $(_opts.apDom).append(_html)
        $(_opts.apDom).find('.imgdiv').each(function(v,n){
            that.imgSize({
                rts:0.8,
                imgSrc:_opts.data[v].url,
                s:function(){
                    $(n).css('background-size','100% auto')
                },
                b:function(){
                    $(n).css('background-size','auto 100%')
                }
            })
            
        })
        return _html
    },
    notNull:function(strings,kus){
        var _kus = ''
        if(arguments[1]){
            _kus = null 
        }
        if(strings != null && strings != undefined && strings != _kus){
            return true
        }else{
            return false
        }
    },
    
}
$(function(){
    // baseFn.loading.call($('body'),'open')
})
 
$.get('http://wechat.xrtn.dmpp.net.cn/children/frontend/web/index.php?r=wechat/check',{url:location.href},function(res){
    var _data = res.data
    wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: _data.appid, // 必填，公众号的唯一标识
        timestamp:_data.timestamp , // 必填，生成签名的时间戳
        nonceStr: _data.noncestr, // 必填，生成签名的随机串
        signature: _data.signature,// 必填，签名
        jsApiList: ['getLocation','chooseImage','previewImage','uploadImage','downloadImage'] // 必填，需要使用的JS接口列表
    });
    if($('.morehotelvue').length == 1){
        baseFn.loading.call($('.morehotelvue'),'open')
    }
    if($('.hoteldetailvue').length == 1){
        baseFn.loading.call($('.hoteldetailvue'),'open')
    }
    wx.ready(function(){
        wx.getLocation({
            type: 'wgs84', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
            success:function(res){
            },
            complete: function (result) {
                var _upDatas = {}
                if(storageControl.isExitStorage('hotelid')){
                    _upDatas.subclinic_id = storageControl.getStorage('hotelid').split(',')[0]
                }
                if(result.errMsg.indexOf('getLocation:cancel') > -1){
                    //取消
                }else if(result.errMsg.indexOf('getLocation:ok') > -1){
                    //成功
                    if(result.latitude != undefined && result.longitude != undefined){
                        _upDatas.lat=result.latitude;
                        _upDatas.lng=result.longitude;
                        storageControl.setStorage({'latlng':[result.latitude,result.longitude]})
                    }
                }
                // var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
                // var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
                // var speed = res.speed; // 速度，以米/每秒计
                // var accuracy = res.accuracy; // 位置精度
                // 更多门店 选择门店                
                if($('.morehotelvue').length == 1){                                  
                    var moreHotelVue = new Vue({
                        el:'.morehotelvue',
                        data:{
                            info:[],
                            curtab:1,
                            noData:true
                        },
                        methods:{
                            getlist:function(e,evt){
                                this.curtab = e
                                var that= this    
                                _upDatas.typeId = this.curtab
                               // $(evt).parents('.tabelm').addClass('active').siblings('.tabelm').removeClass('.tabelm') 
                                if(this.curtab == 0){
                                    that.info = []
                                }else{     
                                    var that= this    
                                    baseFn.loading.call($('.morehotelvue'),'open')       
                                    $.get('http://wechat.xrtn.dmpp.net.cn/children/frontend/web/index.php?r=child/getsubclinic',_upDatas,function(res){
                                        if(res.code == 1){
                                            for(let i=0;i<res.data.length;i++){
                                                res.data[i].imgsize = ''
                                                baseFn.imgSize({
                                                    rts:0.8,
                                                    imgSrc:res.data[i].subclinic_logo,
                                                    s:function(){
                                                        res.data[i]['imgsize'] = false
                                                    },
                                                    b:function(){
                                                        res.data[i]['imgsize']= true
                                                    }
                                                })
                                                if(res.data[i]['isIdle']==0){
                                                    res.data[i]['isIdletxt']='已约满'
                                                }else{
                                                    res.data[i]['isIdletxt']='空闲可约'
                                                }
                                                if(res.data[i]['distance']=="\u672a\u77e5"){
                                                    res.data[i]['distancetxt']="未知"
                                                }else{
                                                    res.data[i]['distancetxt']=res.data[i]['distance']
                                                }
                                                if(res.data[i]['min']=="\u672a\u77e5"){
                                                    res.data[i]['mintxt']="未知"
                                                }else{
                                                    res.data[i]['mintxt']=res.data[i]['distance']
                                                }
                                            }
                                            that.info = res.data
                                        }
                                    },'json').complete(function(){
                                        baseFn.loading.call($('.morehotelvue'),'close')
                                    })   
                                }
                            },
                            hoteldetail:function(elm){
                                var _name = this.info.filter(function(val){
                                    return val.subclinic_id == elm
                                })[0].subclinic_name ;
                                window.localStorage.setItem('hotelid',elm+','+_name)
                                window.location.href="./hoteldetail.html"
                            },
                            headersize:function(e){
                                var _img = new Image()
                                _img.src = e
                                _img.onload=function(){
                                    if(this.width/this.height<=1){
                                        return false
                                    }else{
                                        return true
                                    }
                                }
                            },
                            booking:function(elm){
                                var _elm = this.info.filter(function(val){
                                    return val.subclinic_id == elm
                                })[0]
                                var _name =_elm.subclinic_name,_go=_elm.isIdle;
                                if(_go == 1){
                                    window.localStorage.setItem('hotelid',elm+','+_name)
                                    window.location.href="./order.html"
                                }else{}
                                
                            }
                        },
                        watch:{
                           'info':function(val){
                            console.log(val.length)
                            if(val.length == 0){
                                this.noData=true
                            }else{
                                this.noData=false
                            } 
                           } 
                        },
                        beforeCreate:function(){                      
                            var that= this  
                            _upDatas.typeId = 1        
                            $.get('http://wechat.xrtn.dmpp.net.cn/children/frontend/web/index.php?r=child/getsubclinic',_upDatas,function(res){
                                if(res.code == 1){
                                    that.curtab =1
                                    for(let i=0;i<res.data.length;i++){
                                        res.data[i].imgsize = ''
                                        baseFn.imgSize({
                                            rts:0.8,
                                            imgSrc:res.data[i].subclinic_logo,
                                            s:function(){
                                                res.data[i]['imgsize'] = false
                                            },
                                            b:function(){
                                                res.data[i]['imgsize']= true
                                            }
                                        })
                                        // var _img = new Image()
                                        // _img.src = res.data[i].subclinic_logo
                                        // ss(_img,i)
                                        if(res.data[i]['isIdle']==0){
                                            res.data[i]['isIdletxt']='已约满'
                                        }else{
                                            res.data[i]['isIdletxt']='空闲可约'
                                        }
                                        if(res.data[i]['distance']=="\u672a\u77e5"){
                                            res.data[i]['distancetxt']="未知"
                                        }else{
                                            res.data[i]['distancetxt']=res.data[i]['distance']
                                        }
                                        if(res.data[i]['min']=="\u672a\u77e5"){
                                            res.data[i]['mintxt']="未知"
                                        }else{
                                            res.data[i]['mintxt']=res.data[i]['distance']
                                        }
                                    }
                                    // function ss(dom,ids,rts){
                                    //     dom.onload=function(){
                                    //         if(this.width/this.height <= rts){
                                    //             res.data[ids]['imgsize'] = false
                                    //         }else{
                                    //             res.data[ids]['imgsize']= true
                                    //         }
                                    //     }
                                    // }
                                    that.info = res.data
                                }
                            },'json').complete(function(){
                                baseFn.loading.call($('.morehotelvue'),'close')
                            })
                        }
                    })
                }
                /*
                // 门店详细 
                if($('.hoteldetailvue').length == 1){
                    if(storageControl.isExitStorage('hotelid')){
                        var _upCallDatas={
                            subclinic_id:_upDatas.subclinic_id,
                            ad_type:'1'
                        }
                        var moreWorkerVue = new Vue({
                            el:'.hoteldetailvue',
                            data:{
                                info:{}
                            },
                            methods:{
                                hoteldetail:function(elm){
                                    var _name = this.info.filter(function(val){
                                        return val.subclinic_id == elm
                                    })[0].subclinic_name ;
                                    window.localStorage.setItem('hotelid',elm+','+_name)
                                }
                            },
                            beforeCreate:function(){
                                var that= this
                                $.get('http://wechat.xrtn.dmpp.net.cn/children/frontend/web/index.php?r=child/getsubclinic',_upDatas,function(res){
                                    if(res.code == 1){
                                        // console.log(res.data[0])
                                        baseFn.loading.call($('body'),'close')
                                        that.info = res.data
                                    }
                                },'json').complete(function(){
                                    baseFn.loading.call($('body'),'close');
                                    baseFn.loading.call($('.hoteldetailvue'),'close')
                                })
                            },
                            created:function(){
                                
                            }
                        })
                        // $.get('http://wechat.xrtn.dmpp.net.cn/children/frontend/web/index.php?r=child/getadvert',_upCallDatas,function(res){
                        //     if(res.data.length != 0){
                        //         $('.gblink').attr('href',res.data[0].skip_url).append('<marquee>'+res.data[0].ad_name+'</marquee>')
                                
                        //     }else{
                        //         $('.gblink').attr('href','javascript:void(0)').append('暂无广播')
                        //     }
                            
                        // },'json')   
                    }else{
                        baseFn.popShow({
                            txt:'请选择具体门店',
                            timeable:true,
                            time:1000,
                            ok:function(){
                                window.location.assign('./index.html')
                            }
                        })
                    }
                }
                */
                //全部医师 有地理位置
                if($('.moreworkervue').length == 1 && baseFn.getQueryString('all') == null){
                    var moreWorkerVue = new Vue({
                        el:'.moreworkervue',
                        data:{
                            info:[]
                        },
                        methods:{
                            appointment:function(elm,elm2){
                                var _hotelname = this.info.filter(function(val){
                                    return val.subclinic_id == elm2
                                })[0].subclinic_name ;
                                var _workername = this.info.filter(function(val){
                                    return val.user_id == elm
                                })[0].user_name ;
                                // setSession('appointworker',elm+','+_workername)
                                // setSession('hotelid',elm2+','+_hotelname)
                                storageControl.setStorage({'appointworker':elm+','+_workername,'hotelid':elm2+','+_hotelname})
                                // window.location.href='./o)rder.html'
                            },
                            headersize:function(ids,e){
                                var that = this 
                                var _img = new Image()
                                _img.src = e
                                _img.onload=function(){
                                    if(this.width/this.height<=1){
                                        return false
                                    }else{
                                        return true
                                    }
                                }
                                // return {'bgimg_hsize':true}
                            }
                        },
                        beforeCreate:function(){
                            var that= this
                            $.get('http://wechat.xrtn.dmpp.net.cn/children/frontend/web/index.php?r=child/getalldoctor',_upDatas,function(res){
                                if(res.code == 1){
                                    for(let i=0;i<res.data.length;i++){
                                        res.data[i]['imgsize'] = false
                                        if(res.data[i].user_img != ''){
                                            // res.data[i]['imgsize']=''
                                            baseFn.imgSize({
                                                rts:1,
                                                imgSrc:res.data[i].user_img,
                                                s:function(){
                                                    res.data[i]['imgsize'] = false
                                                },
                                                b:function(){
                                                    res.data[i]['imgsize']= true
                                                }
                                            })
                                        }
                                        if(res.data[i]['distance'] && res.data[i]['distance']=="\u672a\u77e5"){
                                            res.data[i]['distancetxt']="距离未知"
                                        }else{
                                            res.data[i]['distancetxt']=res.data[i]['distance']
                                        }
                                        if(res.data[i]['user_desc'] == null){
                                            res.data[i]['user_desc'] = '暂无介绍'
                                        }
                                        if(res.data[i]['user_title'] == "1"){
                                            res.data[i]['user_titletxt'] = '中医调理师'
                                        }else{
                                            res.data[i]['user_titletxt'] = '调理师'
                                        }
                                        if(res.data[i]['work_year'] == "1"){
                                            res.data[i]['work_yeartxt'] = '十五'
                                        }else{
                                            res.data[i]['work_yeartxt'] = '一'
                                        }
                                        if(res.data[i]['level_type'] == "1"){
                                            res.data[i]['level_typetxt'] = '优秀大夫'
                                        }else{
                                            res.data[i]['level_typetxt'] = '厉害大夫'
                                        }
                                        if(res.data[i]['user_level'] == "3"){
                                            res.data[i]['user_levelName']='副院长'
                                        }else{
                                            res.data[i]['user_levelName']='职工'
                                        }
                                    }
                                    
                                    that.info = res.data
                                }
                            },'json').complete(function(){
                                baseFn.loading.call($('body'),'close')
                            })
                        },
                        created:function(){
                            if(baseFn.getQueryString('all') == null){
                                $('.moreworker_distance').remove()
                            }
                        }
                    })
                }
            }
        });
    });
},'json')


// wx.config({
//     debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
//     appId: '', // 必填，公众号的唯一标识
//     timestamp: , // 必填，生成签名的时间戳
//     nonceStr: '', // 必填，生成签名的随机串
//     signature: '',// 必填，签名
//     jsApiList: [] // 必填，需要使用的JS接口列表
// });
/**/
//storage 操作
function setSession(keys,val){
    window.localStorage.setItem(keys,val)
}
function isExitStorage(keys){
    if(window.localStorage.getItem(keys) != undefined && window.localStorage.getItem(keys) != null && window.localStorage.getItem(keys) != ''){
        return true
    }else{
        return false
    }
}

$(function(){
    $('.tab .tabelm').off('click').on('click',function(val){
        $(this).addClass('active').siblings('.tabelm').removeClass('active')
    })
    $('.quit').on('click',function(){
        baseFn.popShow({
            txt:'确定退出么',
            ok:function(){
                storageControl.removeStorage(['tempUser','userId','hotelid','appointworker','ZuserGender','ZuserName','ZuserPhone'])
                window.location.assign('./sign.html')
            },
            cancel:true
        })
    })
})

